package 药品;

import com.alibaba.fastjson.JSON;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;

public class text_json {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new FileReader("D:\\MP\\药品\\alldata.txt"));
        BufferedWriter bw = new BufferedWriter(new FileWriter("D:\\MP\\药品\\data.json"));
        String line;
        Bean bean = new Bean();
        String json;
        while ((line = br.readLine()) != null) {
            String [] datas = line.split("\t");
            bean.set(datas[0],datas[1],datas[2],datas[3],datas[4],datas[5],datas[6],datas[7],datas[8],datas[9],
                    datas[10],datas[11],datas[12],datas[13],datas[14],datas[15],datas[16],datas[17]);
            json = JSON.toJSONString(bean);
            bw.write(json);
            bw.write("\n");
        }
        br.close();
        bw.close();
    }
}
